<?php if (!defined('THINK_PATH')) exit(); /*a:1:{s:89:"/Users/juyaobin/Desktop/clover_download/application/bbs/view/readarticle/readarticle.html";i:1565275300;}*/ ?>
<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>问题详情</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="keywords" content="fly,layui,前端社区">
    <meta name="description" content="">
    <link rel="stylesheet" href="/public/bbs/module/layui/css/layui.css">
    <link rel="stylesheet" href="/public/bbs/module/css/global.css">
    <script src="/public/jquery/jquery-3.3.1.min.js"></script>
    <script src="/public/layer/layer.js"></script>
    <link rel="stylesheet" href="http://www.pcbeta.com/data/cache/style_6_forum_viewthread.css?hAX">
    <script src="/public/bbs/module/layui/layui.js"></script>
    <script charset="utf-8" src="/public/bbs/module/kindeditor/kindeditor-all.js"></script>
    <script charset="utf-8" src="/public/bbs/module/kindeditor/lang/zh-CN.js"></script>
    <style type="text/css" rel="stylesheet">
        form {
            margin: 0;
        }

        .mod {
            display: flex;
            align-items: center;
            /*垂直居中*/
        }

        .editor {
            margin-top: 5px;
            margin-bottom: 5px;
        }
    </style>
    <link rel="stylesheet" type="text/css" href="/public/bbs/readarticle/style_6_forum_viewthread.css">
    <link rel="stylesheet" type="text/css" href="/public/bbs/readarticle/1.css">
    <link rel="stylesheet" href="/public/bbs/readarticle/inserthtml.com.radios.css">
    <link rel="stylesheet" href="/public/bbs/readarticle/style.css">


</head>

<body>
    <?php echo $head; ?>
    <div class="global main layui-clear">
        <div class="global wrap">
            <div class="global content detail">
                <div class="global fly-panel detail-box">
                    <h1><?php echo $article['title']; ?></h1>
                    <div class="global fly-tip fly-detail-hint" data-id="">
                        <span class="global fly-tip-stick">置顶帖</span>
                        <span class="global jie-admin">
                            <a>点击置顶</a>
                        </span>
                        <span class="global layui-btn layui-btn-mini jie-admin">
                            <a>取消置顶</a>
                        </span>
                        <?php if($me['id'] == $article['user_id']): ?>
                        <span onclick="del()" class="global jie-admin" type="del" style="margin-left: 20px;">
                            <a>删除该帖</a>
                        </span>
                        <script>
                            function del() {
                                $.ajax({
                                type: "POST",
                                url: '<?php echo url("bbs/readarticle/del_article"); ?>',
                                data: {
                                    'time':'<?php echo rsa_encode(time()); ?>',
                                    '<?php echo rsa_encode(time()); ?>':'<?php echo rsa_encode("$get_id"); ?>',
                                },
                                dataType: "JSON",
                                success: function (response) {
                                    if (response.code == 0) {
                                        alert('删除成功');
                                        location.reload();
                                    }else{
                                        alert(response.msg)
                                    }
                                }
                            });
                            }
                        </script>
                        <?php endif; ?>
                        <div class="global fly-list-hint">
                            <i class="global iconfont" title="回答">&#xe60c;</i> <?php echo count($comment); ?>
                        </div>
                    </div>
                    <div class="global detail-about">
                        <a class="global jie-user"> <img src="<?php echo $user_info['head_src']; ?>" alt="头像"> <cite>
                                <?php if($article['nickname']): ?>
                                <i><?php echo $article['nickname']; ?></i>
                                <?php else: ?>
                                <i><?php echo $article['user_name']; ?></i>
                                <?php endif; ?>
                                <em><?php echo $article['release_time']; ?> 发布</em> </cite> </a>
                        <div class="global detail-hits" data-id="{{rows.id}}">
                            <span class="global layui-btn layui-btn-mini jie-admin"><a href="#">已完帖，无法编辑</a> </span> <span
                                class="global layui-btn layui-btn-mini jie-admin" type="collect" data-type="add"> <a
                                    id="collectPost">收藏</a> </span> <span
                                class="global layui-btn layui-btn-mini jie-admin  layui-btn-danger" type="collect"
                                data-type="add"> <a>取消收藏</a> </span>

                        </div>
                    </div>
                    <div class="global detail-body photos" style="margin-bottom: 20px;">
                        <p><?php echo $article['content']; ?></p>
                    </div>
                </div>
                <div class="global fly-panel detail-box" style="padding-top: 0;">
                    <ul class="global jieda photos" id="comment">

                        <?php if($comment): if(is_array($comment) || $comment instanceof \think\Collection || $comment instanceof \think\Paginator): $key = 0; $__LIST__ = $comment;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($key % 2 );++$key;if($vo['father']): ?>

                        <div style=" background: rgb(237, 251, 255)" class="global quote">
                            <blockquote>
                                <font size="2">
                                    <font color="#999999">
                                        <?php echo $vo['father']['user_name']; ?> 发表于 <?php echo $vo['father']['comments_time']; ?>
                                    </font>
                                </font>
                                <li>
                                    <span style="float: left;">
                                        <?php echo $vo['father']['comments_body']; ?>
                                    </span>
                                    <i class="global iconfont icon-floor-son" style="float: right;"
                                        title="<?php echo $vo['comment_me_id']; ?>F"><?php echo $vo['father']['comment_me_id']; ?>F</i>
                                </li>
                            </blockquote>
                        </div>

                        <div>
                            <li>
                                <div style="margin:auto;width: 90%;">
                                    <div class="global detail-about detail-about-reply">
                                        <a class="global jie-user"> <img src="<?php echo $vo['head_src']; ?>" alt=""> <cite>
                                                <?php if($vo['nickname']): ?>
                                                <i><?php echo $vo['nickname']; ?></i>
                                                <?php else: ?>
                                                <i><?php echo $vo['user_name']; ?></i>
                                                <?php endif; if($me['id'] == $article['user_id']): ?>
                                                <em style="color:rgb(255, 0, 179)">
                                                    我自己
                                                </em>
                                                <?php endif; if($vo['id'] == $article['user_id']): ?>
                                                <em style="color:#FF9E3F">
                                                    楼主
                                                </em>
                                                <?php endif; ?>
                                            </cite>
                                        </a>
                                        <div class="global detail-hits">
                                            <span><?php echo $vo['comments_time']; ?></span>
                                        </div>
                                        <i class="global iconfont icon-floor" title="最佳答案"><?php echo $key; ?>F</i>
                                    </div>
                                    <div class="global detail-body jieda-body">
                                        <p><?php echo $vo['comments_body']; ?></p>
                                    </div>
                                </div>
                                <div class="global jieda-reply">
                                    <span class="global jieda-zan" type="zan"><i
                                            class="global iconfont icon-zan"></i><em><?php echo $vo['praise']; ?></em>
                                    </span>
                                    <?php if(($vo['start'] == 0) OR ($article['user_id'] == $me['id'] ) AND ($vo['start'] !=
                                    1)): ?>
                                    <!-- <div class="global jieda-admin">
                                        <span type="del"><a href="#"
                                                class="global layui-btn layui-btn-danger layui-btn-small">删除</a></span>
                                        <span class="global jieda-accept" type="accept">
                                            <a href="#" class="global layui-btn  layui-btn-small">采纳</a></span>
                                    </div> -->
                                    <?php if($me['id']): ?>
                                    <div class="global jieda-admin">
                                        <span onclick="Reply('<?php echo $vo['comments_id']; ?>')" type="del"><a
                                                class="global layui-btn layui-btn-danger layui-btn-small">回复</a></span>
                                    </div>
                                    <?php endif; endif; ?>
                                </div>
                            </li>
                        </div>
                        <?php else: ?>
                        <li data-id="13">
                            <div class="global detail-about detail-about-reply">
                                <a class="global jie-user"> <img src="<?php echo $vo['head_src']; ?>" alt=""> <cite>
                                        <?php if($vo['nickname']): ?>
                                        <i><?php echo $vo['nickname']; ?></i>
                                        <?php else: ?>
                                        <i><?php echo $vo['user_name']; ?></i>
                                        <?php endif; if($me['id'] == $vo['user_id']): ?>
                                        <em style="color:rgb(255, 0, 179)">
                                            我自己
                                        </em>
                                        <?php endif; if($vo['id'] == $article['user_id']): ?>
                                        <em style="color:#FF9E3F">
                                            楼主
                                        </em>
                                        <?php endif; ?>

                                    </cite>
                                </a>
                                <div class="global detail-hits">
                                    <span><?php echo $vo['comments_time']; ?></span>
                                </div>
                                <i class="global iconfont icon-floor" title="最佳答案"><?php echo $key; ?>F</i>
                            </div>
                            <div class="global detail-body jieda-body">
                                <p><?php echo $vo['comments_body']; ?></p>
                            </div>
                            <div class="global jieda-reply">
                                <?php if(($vo['start'] == 0) OR ($article['user_id'] == $me['id'] )): ?>

                                <span class="global jieda-zan" type="zan"><i
                                        class="global iconfont icon-zan"></i><em><?php echo $vo['praise']; ?></em>
                                </span>
                                <!-- <div class="global jieda-admin">
                                    <span type="del"><a href="#"
                                            class="global layui-btn layui-btn-danger layui-btn-small">删除</a></span>
                                    <span class="global jieda-accept" type="accept">
                                        <a href="#" class="global layui-btn  layui-btn-small">采纳</a></span>
                                </div> -->
                                <?php if($me['id']): ?>
                                <div class="global jieda-admin">
                                    <span onclick="Reply('<?php echo $vo['comments_id']; ?>')" type="del"><a
                                            class="global layui-btn layui-btn-danger layui-btn-small">回复</a></span>
                                </div>
                                <?php endif; endif; ?>

                            </div>
                        </li>
                        <?php endif; endforeach; endif; else: echo "" ;endif; else: ?>
                        <li class="global fly-none">没有任何回答</li>
                        <?php endif; ?>
                    </ul>
                    <span id="toName" style="color: blue">
                        @ <?php if($article['nickname']): ?>
                        <i><?php echo $article['nickname']; ?></i>
                        <?php else: ?>
                        <i><?php echo $article['user_name']; ?></i>
                        <?php endif; ?>(楼主)
                    </span>
                    <div class="global layui-form layui-form-pane">
                        <div class="global layui-form-item layui-form-text">
                            <div class="global layui-input-block">
                                <textarea id="editor_id" name="content"
                                    placeholder="<?php echo $web_settings['bbs_readarticle_comment_text']; ?>"
                                    class="global layui-textarea fly-editor" style="height: 150px;"
                                    style="width:700px;height:300px;"
                                    placeholder="啊啊"><?php echo $web_settings['bbs_readarticle_comment_text']; ?></textarea>
                            </div>
                        </div>
                        <div class="global layui-form-item">
                            <div style='float: left;'>
                                <button class="global layui-btn" id="Release" lay-filter="*" lay-submit>提交评论</button>
                            </div>
                            <div class="global mod" style='float: right;'>
                                <input class='global checkbox' type="checkbox" value='0' id="checkbox-11-1" /><label
                                    style='font-size: 62.5%;' for="checkbox-11-1"></label>
                                仅自己/楼主可见
                                <input class='global checkbox' type="checkbox" value='0' id="checkbox-11-2" /><label
                                    style='font-size: 62.5%;' for="checkbox-11-2"></label>
                                回复我邮件通知我
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="global edge">
            <dl class="global fly-panel fly-list-one">
                <dt class="global fly-panel-title">最近热帖</dt>
                <dd>
                    <a>使用 layui 秒搭后台大布局（基本结构）</a> <span><i class="global iconfont">&#xe60b;</i> 6087</span>
                </dd>
                <dd>
                    <a>Java实现LayIM后端的核心代码</a> <span><i class="global iconfont">&#xe60b;</i>
                        767</span>
                </dd>
                <dd>
                    <a>使用 layui 秒搭后台大布局（基本结构）</a> <span><i class="global iconfont">&#xe60b;</i> 6087</span>
                </dd>
                <dd>
                    <a>Java实现LayIM后端的核心代码</a> <span><i class="global iconfont">&#xe60b;</i>
                        767</span>
                </dd>
                <dd>
                    <a>使用 layui 秒搭后台大布局（基本结构）</a> <span><i class="global iconfont">&#xe60b;</i> 6087</span>
                </dd>
                <dd>
                    <a>Java实现LayIM后端的核心代码</a> <span><i class="global iconfont">&#xe60b;</i>
                        767</span>
                </dd>
                <dd>
                    <a>使用 layui 秒搭后台大布局（基本结构）</a> <span><i class="global iconfont">&#xe60b;</i> 6087</span>
                </dd>
                <dd>
                    <a>Java实现LayIM后端的核心代码</a> <span><i class="global iconfont">&#xe60b;</i>
                        767</span>
                </dd>
            </dl>

            <dl class="global fly-panel fly-list-one">
                <dt class="global fly-panel-title">近期热议</dt>
                <dd>
                    <a>使用 layui 秒搭后台大布局之基本结构</a> <span><i class="global iconfont">&#xe60c;</i> 96</span>
                </dd>
                <dd>
                    <a>使用 layui 秒搭后台大布局之基本结构</a> <span><i class="global iconfont">&#xe60c;</i> 96</span>
                </dd>
                <dd>
                    <a>使用 layui 秒搭后台大布局之基本结构</a> <span><i class="global iconfont">&#xe60c;</i> 96</span>
                </dd>
                <dd>
                    <a>使用 layui 秒搭后台大布局之基本结构</a> <span><i class="global iconfont">&#xe60c;</i> 96</span>
                </dd>
                <dd>
                    <a>使用 layui 秒搭后台大布局之基本结构</a> <span><i class="global iconfont">&#xe60c;</i> 96</span>
                </dd>
                <dd>
                    <a>使用 layui 秒搭后台大布局之基本结构</a> <span><i class="global iconfont">&#xe60c;</i> 96</span>
                </dd>
                <dd>
                    <a>使用 layui 秒搭后台大布局之基本结构</a> <span><i class="global iconfont">&#xe60c;</i> 96</span>
                </dd>
                <dd>
                    <a>使用 layui 秒搭后台大布局之基本结构</a> <span><i class="global iconfont">&#xe60c;</i> 96</span>
                </dd>
            </dl>
        </div>
    </div>
    <script type="text/javascript">
        var editor;
        KindEditor.ready(function (K) {
            editor = K.create('#editor_id', {
                resizeType: 2,
                uploadJson: '<?php echo url("upload/index/image_upload"); ?>', // 相对于当前页面的路径
                newlineTag: 'br', //回车换行br|p
                afterBlur: function () {
                    editor.sync();
                    if (editor.html() == '<br />' || editor.html() == '') {
                        editor.html("<?php echo $web_settings['bbs_readarticle_comment_text']; ?>");
                        $("#qstContent").contents().find(".ke-content").css("color", "red");
                    }
                },
                afterFocus: function () {
                    if (editor.html() == "<?php echo $web_settings['bbs_readarticle_comment_text']; ?>") {
                        editor.html('');
                        // 输入文字变为黑色
                        $("#qstContent").contents().find(".ke-content").css("color", "#fff");
                    }
                },
            }); {
                $editor_readonly
            } //动态加载是否禁用ke编辑器
        });
        $('#Release').click(function (e) {
            index = layer.msg('加载中', {
                icon: 16,
                shade: 0.01,
                time: 9999999999,
            });
            e.preventDefault();
            html = $('#editor_id').val();
            $.ajax({
                type: "POST",
                url: "<?php echo url('bbs/readarticle/comment_release'); ?>",
                data: {
                    id: '<?php echo $get_id; ?>',
                    RandStr: '<?php echo $bbs_ReadArticle_RandStr; ?>',
                    comment: html,
                    // title: encodeURIComponent(rsa_encode('<?php echo $article["title"]; ?>', '<?php echo $web_settings['rsa_public']; ?>')),
                    title: '<?php echo rsa_encode($article["title"]); ?>',
                    email: '<?php echo rsa_encode('$me["email"]'); ?>',
                    Home_id: '<?php echo rsa_encode($article['user_id']); ?>',
                    son: false,
                    checkbox: $('#checkbox-11-1').val(),
                },
                dataType: "json",
                success: function (response) {
                    if (response.code == 1) {
                        $('#comment').append(response.msg);
                        layer.close(index);
                    } else {
                        layer.tips('发生意外错误错题提示/信息' + response.msg + '请联系管理员', '#Release', {
                            tips: [1, '#3595CC'],
                            time: 4000
                        });
                        return;
                    }
                }
            });
        });
        $('#checkbox-11-1').click(function (e) {
            if ($('#checkbox-11-1').val() == 2) {
                $('#checkbox-11-1').val(0);
            } else {
                $('#checkbox-11-1').val(2);
            }

        });
        $('#checkbox-11-2').click(function (e) {
            // if ($('#checkbox-11-2').val() == 2) {
            //     $('#checkbox-11-2').val(0);
            // } else {
            //     $('#checkbox-11-2').val(2);
            // }
            alert('待完善');
        });

        function Reply(id) {
            layer.open({
                type: 2,
                area: ['700px', '450px'],
                fixed: false, //不固定
                maxmin: true,
                content: '<?php echo url("bbs/readarticle/reply_son"); ?>?article_id=<?php echo $get_id; ?>&comment_id=' + id
            });
        }
    </script>
</body>

</html>